x86 vpt: Small performance fixes.
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Sep 2009 08:50:46 +0000 (09:50 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 3 Sep 2009 08:50:46 +0000 (09:50 +0100)
1. once one-shot timer is fired, IRQ is raised repeatedly forever.
2. Test pending_intr_nr before pt_irq_masked(), as it is cheaper.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
xen/arch/x86/hvm/vpt.c

index 0cb180ceba92d8005b4bc8ed28437edd78d0a1aa..7721873f2c7c0d26d03ceb231eca4b77400ab614 100644 (file)
@@ -229,7 +229,7 @@ void pt_update_irq(struct vcpu *v)
 
     list_for_each_entry ( pt, head, list )
     {
-        if ( !pt_irq_masked(pt) && pt->pending_intr_nr &&
+        if ( pt->pending_intr_nr && !pt_irq_masked(pt) &&
              ((pt->last_plt_gtime + pt->period) < max_lag) )
         {
             max_lag = pt->last_plt_gtime + pt->period;
@@ -298,6 +298,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack)
         if ( pt->on_list )
             list_del(&pt->list);
         pt->on_list = 0;
+        pt->pending_intr_nr = 0;
     }
     else
     {